﻿@{
    ViewBag.Title = "Home Page";
}
<!--rottentomatoes - new films in israel-->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.5.1/jquery.min.js"></script>

<script>
    var apikey = "h4yazr3v79uyb722zbaa6ypt";
    var baseUrl = "http://api.rottentomatoes.com/api/public/v1.0";

    // construct the uri with our apikey
    var moviesSearchUrl = baseUrl + '/lists/movies/in_theaters.json?apikey=' + apikey + "&" + "page_limit=4";

    $(document).ready(function () {

        // send off the query
        $.ajax({
            url: moviesSearchUrl,
            dataType: "jsonp",
            success: searchCallback
        });
    });

    // callback for when we get back the results
    function searchCallback(data) {
        $("#nowinil").append('Found ' + data.total + ' results for Israel');
        var movies = data.movies;
        $.each(movies, function (index, movie) {
            //pc
            $("#nowinil").append('<div class="col-md-3"><h3>' + movie.title + '</h3><img src="' + movie.posters.thumbnail + '" /></div>');
        });
    }
</script>

<div class="jumbotron">
    <img src="~/images/Film8LogoT.png" class="center-block" alt="Film8" />
</div>
<div class="row">
    <div class="col-md-4">
        <h2>Welcome to Film8</h2>
        <p>
            Film8 is a place for you to share your favorite movies and find recommendations for movies you have not seen yet, based on your own taste.
        </p>
    </div>
    
</div>
<div class="row">
    <div class="col-md-4"><h2>Now In Theaters</h2></div>
    <div class="col-md-4"></div>
    <div class="col-md-4"></div>
</div>
<div class="row" id="nowinil" style="text-align:center">
</div>
